package com.tebiecloud.yunst.client.service;

import com.tebiecloud.common.model.ResultBody;
import com.tebiecloud.yunst.client.model.entity.YunAgentCollect;
import com.tebiecloud.yunst.client.model.entity.YunWithdrawApply;
import com.tebiecloud.yunst.client.model.vo.PayInfoVO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 云商通支付接口
 */
public interface IYunStPaymentServiceClient {


    /**
     * 获取订单支付信息
     * @param userId //创建订单人的userId
     * @param orderId //订单id
     * @param amount //金额（单位：分）
     * @param payMethodStr //支付方式:默认WECHAT_PUBLIC
     * @param openId //用户第三方标识，微信公众号支付使用微信用户在公众的openId
     * @param expiredTime //订单有效时间（单位：秒）
     * @return
     */
    @PostMapping("/feign/payment/consumeApply")
    ResultBody<PayInfoVO> consumeApply(
            @RequestParam(value = "userId") Long userId,
            @RequestParam(value = "orderId") Long orderId,
            @RequestParam(value = "amount") Integer amount,
            @RequestParam(value = "payMethodStr") String payMethodStr,
            @RequestParam(value = "openId") String openId,
            @RequestParam(value = "expiredTime") int expiredTime);


    /**
     * 获取支付信息
     * @param orderId
     * @return
     */
    @PostMapping("/feign/payment/paymentInfo")
    ResultBody<PayInfoVO> paymentInfo(
            @RequestParam(value = "orderId") Long orderId);

    /**
     * 更新支付超时支付信息
     * @param orderId
     * @param payStatus
     * @return
     */
    @PostMapping("/feign/payment/updateYunAgentCollect")
    ResultBody updateYunAgentCollect(
            @RequestParam(value = "orderId") long orderId,
            @RequestParam(value = "payStatus") int payStatus);

    /**
     * 支付接口---废弃
     * @param payerId
     * @param bizUserId
     * @param orderNo
     * @param amount
     * @param payMethodStr
     * @param wxOpenId
     * @return
     */
    @PostMapping("/feign/payment/agentCollect")
    ResultBody agentCollect(
            @RequestParam(value = "payerId") String payerId,
            @RequestParam(value = "bizUserId") String bizUserId,
            @RequestParam(value = "orderNo") Long orderNo,
            @RequestParam(value = "amount") Integer amount,
            @RequestParam(value = "payMethodStr") String payMethodStr,
            @RequestParam(value = "wxOpenId") String wxOpenId);

    /**
     * 支付回调接口
     * @param rps
     */
    @RequestMapping("/feign/payment/payCallBack")
    ResultBody<YunAgentCollect> payCallBack(@RequestParam(value = "rps") String rps);

    @RequestMapping("/feign/payment/withdrawCallBack")
    ResultBody<YunWithdrawApply> withdrawCallBack(@RequestParam(value = "rps") String rps);
}
